<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>过滤器</title>
</head>
<body>
<div id="app">
     价格：{{price|toMoney2('dd')|addLine}}
</div>
</body>
<script src="../../../lib/vue.js"></script>
<script>
    new  Vue({
        el:'#app',
        data:{
            price:100.20
        },filters:{
            toMoney:function (val) {
                return "$ " +val;
            },
            toMoney2:function (val,type) {
                if(type=="us"){
                    return "$ "+val;
                }else {
                     return  "￥ "+ val;
                }
            },
            addLine:function (val) {
                return "-"+val;
            }

        }
    })

</script>
</html>